﻿using UnityEngine;

public class StoneButton:MonoBehaviour
{
    public bool isOpen = false;
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (isOpen) return;

        if(collision.gameObject.GetComponent<Player>()!=null)
        {
            transform.parent.GetComponent<StoneDoor>().PlayAni();
            isOpen = true;
        }
    }
}